[Unit]
Description=Kubernetes Kubelet
Documentation=https://github.com/GoogleCloudPlatform/kubernetes
After=docker.service
Requires=docker.service
[Service]
WorkingDirectory={{ KUBELET_DIR }}
ExecStart=/opt/kubernetes/server/bin/kubelet \
  --allow-privileged=true \
  --bootstrap-kubeconfig=/etc/kubernetes/cert/kubelet-bootstrap.kubeconfig \
  --cert-dir=/etc/kubernetes/cert \
  --network-plugin=cni \
  --cni-conf-dir=/etc/cni/net.d \
  --container-runtime=docker \
  --container-runtime-endpoint=unix:///var/run/dockershim.sock \
  --root-dir={{ KUBELET_DIR }} \
  --kubeconfig=/etc/kubernetes/cert/kubelet.kubeconfig \
  --config=/etc/kubernetes/cert/kubelet-config.yaml \
  --hostname-override={{ ansible_default_ipv4.address }} \
  --pod-infra-container-image=gcr.azk8s.cn/google_containers/pause-amd64:3.1 \
  --image-pull-progress-deadline=15m \
  --volume-plugin-dir={{ KUBELET_VOLUME_PLUGIN_DIR }} \
  --feature-gates=RotateKubeletClientCertificate=true,RotateKubeletServerCertificate=true \
  --rotate-server-certificates=true \
  --rotate-certificates=true \
  --logtostderr=false \
  --log-dir={{ KUBELET_LOG_DIR }}\
  --v=2
Restart=always
RestartSec=5
StartLimitInterval=0
[Install]
WantedBy=multi-user.target
